package com.tn.wservice;

import java.util.HashMap;

import com.tn.bo.Invoice;
import com.tn.service.dwr.InvoiceDwr;
import com.tn.wservice.IYSNWebService.ParamKey;
import com.tn.xfer.DwrResponse;

public class InvoiceWebService {
	InvoiceDwr invoiceDwr = new InvoiceDwr();

	@BusinessObject(value = Invoice.class)
	public Object createOrSavePurchaseOrder(HashMap<ParamKey, Object> map) {
		Invoice input = (Invoice) map.get(ParamKey.BUSINESS_OBJECT);
		DwrResponse response = invoiceDwr.submitInvoice(input);

		return response;
	}

	@BusinessObject(value = InvoiceApproveRequest.class)
	public Object approveInvoice(HashMap<ParamKey, Object> map) {
		InvoiceApproveRequest input = (InvoiceApproveRequest) map
				.get(ParamKey.BUSINESS_OBJECT);
		DwrResponse response = invoiceDwr.approveInvoice(input);

		return response;
	}
}
